package lesson01;

/**
 * 在子线程执行完毕后再执行主线程代码
 *
 * @author wileda
 * @date 2023/01/10  11:53
 */
public class Demo10 {
    public static int count = 0;
    public static void main(String[] args) throws InterruptedException {
        for (int i = 0; i < 20; i++) {
            Thread thread = new Thread(() ->{
                System.out.println("线程" + count++);
            });
            thread.start();
            thread.join();
        }
        System.out.println("ok");
    }
}
